//package com.demo.miya.controller;
//
//import com.demo.miya.controller.client.SeataMiyaClient;
//import com.demo.miya.dao.mapper.UserMapper;
//import com.demo.miya.model.User;
//import io.seata.spring.annotation.GlobalTransactional;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//
///**
// * seata miya控制层
// * @author cyj
// */
//@Slf4j
//@RestController
//public class SeataMiyaController implements SeataMiyaClient {
//
//    @Resource
//    private UserMapper userMapper;
//
//    @Override
//    public void insertError(Long userId) {
//        log.info("insertError userId:{}", userId);
//        throw new RuntimeException("SeataMiyaController.insertError 异常");
//    }
//
//    @Override
//    @GlobalTransactional(rollbackFor = Exception.class)
//    public void insert(Long userId) {
//        log.info("insert 方法，userId = {}", userId);
//        User user = new User().setUserId(userId);
//        userMapper.insertSelective(user);
//    }
//}
